<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<form action="role/updateSubmit.shtml" class="pageForm"
	  data-toggle="validate" data-callback="formBack"
	  method="post" id="addForm" data-toggle="ajaxform">
	<input type="hidden" name="id" value="${role.id}"/>
	<div class="bjui-pageContent">
		<div class="panel panel-default">
			<div class="panel-body">
				<div class="row" style="text-align: center">
					<div class="col-md-12">
						<div class="form-group">
							&nbsp;&nbsp;<label class="control-label x180">角色名称：</label>
                            <input type="text"  name="name" id="name" class="form-control" value="${role.name }"data-rule="required;length[~20]" style="width: 200px;" /><font color="red">*</font>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<label class="control-label x180">角色类型：</label><select name="type" id="roleType"
								data-width="200" class="form-control" data-toggle="selectpicker" >
							</select>
						</div>
					</div>
					<div class="col-md-12">
						<div class="form-group">
							<label class="control-label x180">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：</label>
							<textarea rows="3" cols="20" id="remark" name="remark" data-rule="length[~50]">${role.remark }</textarea>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="bjui-pageFooter">
		<ul>
			<li><button type="submit" class="btn-primary">保存</button></li>
			<li><button type="button" class="btn-close">关闭</button></li>
		</ul>
	</div>
</form>
<script type="text/javascript">
    function formBack(json) {
        if (json.code == BJUI.statusCode.success) {
            $(this).alertmsg('ok', '编辑成功！')
            $(this).navtab('refresh');
            $(this).dialog('closeCurrent');
        }else {
            $(this).alertmsg('error', '编辑失败！')
        }
    }

    $(function () {
        initSelect(false, "#roleType", ${roleTypes}, false, ${role.type==null?-1:role.type});
    });
</script>